
var form = layui.form;
var $ = layui.jquery;
var layer = layui.layer;	
var element =layui.element;
var laytpl = layui.laytpl;
var laypage = layui.laypage;
var upload = layui.upload;

function toJsp(url){
	location.href = base.app + url;
}

function toClose(){ // 当你在iframe页面关闭自身是
	var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
	parent.layer.close(index); //再执行关闭   
}

function openLayer(url,func){
	layer.open({
		type:2,
		area:['750px','500px'],
		maxmin:true,
		end:func,
		content:base.app+url
	})
}

function ajax(field,url,dataType,func){
	$.ajax({
		url:base.app+url,
		type:"post",
		data:field,
		dataType:dataType,
		success:func
	})
}

function formOn(event,url,dataType,func){
	form.on(event,function(data){
		ajax(data.field,url,dataType,func)
	})
}

function openConfirm(func,title){
	layer.confirm(title?title:"确定进行该操作？",{
		icon:3,
		title:"提示"
	},func)
}

function getlaytpl(sel,data){
	return laytpl($(sel).html()).render(data)
}

function setPageInfo(elem,count,curr,limit,jump){
	laypage.render({
		elem:elem,
		count:count,
		curr:curr,
		limit:limit,
		limits:[10,20,30,40,50],
		layout:['count','prev','page','next','limit','refresh','skip'],
		jump:jump
	})
}